home *** CD-ROM | disk | FTP | other *** search
- /*
- File: UViewStatusInfo.h
-
- Contains: *** put contents here ***
-
- Written by: Steve Datnow
-
- Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- 8/24/93 SLD Add Bullet text
- 8/18/93 SLD Add FixedPopup
- 4/2/93 KSS Add new status items.
- 1/21/92 SLD *** put comment here ***
-
- To Do:
- */
-
- #ifndef __UViewStatusInfo__
- #define __UViewStatusInfo__
-
- #ifndef __PACKAGES__
- #include <Packages.h>
- #endif
-
- #ifndef __UDIALOG__
- #include <UDialog.h>
- #endif
-
- #ifndef __UGRIDVIEW__
- #include <UGridView.h>
- #endif
-
- #ifndef __UVIEW__
- #include <UView.h>
- #endif
-
- // Forward and external classes (see Types.h for PascalObj macro)
- //----------------------------------------------------------------------------------------
-
- class PascalObj TDocumentSecondStomach;
- class PascalObj TStream;
-
- /***********************************|****************************************/
-
- //----------------------------------------------------------------------------------------
- // TViewStatusInfo
- //----------------------------------------------------------------------------------------
-
- class TViewMonitorStaticText : public TStaticText
- {
- public: TViewMonitorStaticText();
-
- virtual pascal void IViewMonitorStaticText(TView* itsSuperView,
- const VPoint& itsLocation,
- const VPoint& itsSize,
- SizeDeterminer itsHSizeDet,
- SizeDeterminer itsVSizeDet,
- ResNumber itsRsrcID,
- short itsIndex);
- // Initialize the static text field procedurally.
-
- virtual pascal void GetText(CStr255& theText);
- };
-
- /***********************************|****************************************/
-
- class TViewMonitorStatus: public TViewMonitorStaticText
- {
- virtual pascal void Initialize();
-
-
- virtual pascal void SuperViewChangedFrame(const VRect& oldFrame,
- const VRect& newFrame,
- Boolean invalidate);
- public :
- virtual pascal void SetText(const CStr255& theText,
- Boolean redraw);
-
- virtual pascal void BlinkText();
-
- protected:
- CStr255 fOldText;
- unsigned long fBlinkStatusTimer;
- };
-
- /***********************************|****************************************/
-
- class TViewNumStatusInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- };
-
- /***********************************|****************************************/
-
- class TViewNumKilobytesStatusInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- };
-
-
- /***********************************|****************************************/
-
- class TViewNumBytesStatusInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- };
-
- /***********************************|****************************************/
-
- class TViewStrStatusInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- };
-
- /***********************************|****************************************/
-
- class TViewTimeStatusInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- };
-
- /***********************************|****************************************/
-
- class TViewTimeStatusWithSecondsInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- };
-
- /***********************************|****************************************/
-
- class TViewElaspedTimeStatusInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- };
-
- /***********************************|****************************************/
-
- class TViewElaspedTimeWithSecondsStatusInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- };
-
- /***********************************|****************************************/
-
- class TViewDateStatusInfo: public TViewMonitorStaticText
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
- virtual pascal DateForm GetDateFormat();
- };
-
- /***********************************|****************************************/
-
- class TViewlongDateStatusInfo: public TViewDateStatusInfo
- {
- virtual pascal DateForm GetDateFormat();
- };
-
- /***********************************|****************************************/
-
- class TViewshortDateStatusInfo: public TViewDateStatusInfo
- {
- virtual pascal DateForm GetDateFormat();
- };
-
- /***********************************|****************************************/
-
- class TViewabbrevDateStatusInfo: public TViewDateStatusInfo
- {
- virtual pascal DateForm GetDateFormat();
- };
-
- /***********************************|****************************************/
-
- class TViewlogStatusInfo : public TTextListView
-
- {
- virtual pascal void Initialize();
-
- virtual pascal void IRes(TDocument* itsDocument,
- TView* itsSuperView,
- TStream* itsParams);
-
- pascal void DoPostCreate(TDocument* itsDocument);
-
-
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
-
- virtual pascal void GetItemText(short,
- CStr255&);
- virtual pascal void Free();
-
- public:
- pascal void AddToLog(CStr255 theText);
- protected:
- TDynamicArray* fTextList;
- };
-
-
-
- /***********************************|****************************************
- *
- * This class implements a filled-status-bar, like the Appleshare 3.0
- * "CPU Usage" bar -- a rectangle which fills (current/(high-low))% of
- * the rectangle with black and the remainder with white.
- *
- ***********************************|****************************************/
-
- typedef struct StatusBarValuesRec {
- unsigned long low;
- unsigned long high;
- unsigned long current;
- } StatusBarValuesRec;
-
- class TLeftFilledStatusBarView : public TView
- {
- public:
- TLeftFilledStatusBarView();
- virtual pascal void Draw(const VRect& area); //Override
-
-
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace); //Override
-
- private: StatusBarValuesRec fStatusBarValues;
-
- };
-
- /***********************************|****************************************/
-
- class TMonitorButton : public TButton
- {
- virtual pascal void DoUpdate(ChangeID theChange,
- TObject* changedObject,
- TObject* changedBy,
- TDependencySpace* dependencySpace);
-
- virtual pascal void DoEvent(EventNumber eventNumber, TEventHandler* source,
- TEvent* event); //Override
-
- };
-
- /***********************************|****************************************/
-
- //----------------------------------------------------------------------------------------
- // Global initialization procedure
- //----------------------------------------------------------------------------------------
-
- extern pascal void InitUViewStatusInfo();
- // Call this routine at initialization time
-
- //----------------------------------------------------------------------------------------
- // TIDList
- //----------------------------------------------------------------------------------------
-
- /***********************************|****************************************/
-
- class TStatusItemList : public TList
- {
- virtual pascal CompareResult CompareElements(void* Element1, void* Element2);
- };
-
- /***********************************|****************************************/
-
- class TStatusItem : public TObject
- {
- public:
- TStatusItem();
-
- virtual pascal void SetID(IDType theID);
- virtual pascal IDType GetID();
-
- virtual pascal void SetDescType(IDType theID);
- virtual pascal IDType GetDescType();
-
- virtual pascal Boolean GetInfo(void* info, long& fInfoSize, DescType desiredType);
- virtual pascal void SetInfo(void* info, long infoSize, DescType actualType);
-
- // Pass a null to set to no info
-
- private:
- IDType fIdentifier;
- DescType fDataType;
- Ptr fData;
- long fDataSize;
- };
-
- /***********************************|****************************************/
-
- class TFixedPopup : public TPopup
- {
- virtual pascal MenuHandle GetMenuHandle();
- };
-
- /***********************************|****************************************/
-
- class PascalObj TBulletTextBehavior;
-
- class TBulletEditText : public TEditText
- {
- private:
- CStringHandle fRealDataHandle;
- TBulletTextBehavior* fBulletTextBehavior;
-
- public:
- virtual pascal void Initialize(); // Override
-
- virtual pascal void Free(); // Override
-
- virtual pascal TDialogTEView* GetTEView(); // Override
-
- virtual pascal void ReleaseTEView(); // Override
-
- virtual pascal void SetText(const CStr255& theText, Boolean redraw); // Override
-
- virtual pascal void StopEdit(); // Override
-
- virtual pascal void AddCharacter(char ch);
-
- virtual pascal void GetRealText(CStr255& theText);
-
- virtual pascal void DelChars();
-
- };
-
- #endif
-